/*
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2024-03-26 23:21:47
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2024-04-22 10:48:33
 * @FilePath: \project\node-project\server\models\UserModel.js
 * @Description: user模型
 */

const moongoose = require('mongoose');
const Schema = moongoose.Schema;

// 字段类型

const userType = {
    username: String,
    password: String,
    gender: Number, // 0:男 1:女
    description: String, // 简介
    email: String,
    phone: String,
    role: Number, // 0:普通用户 1:管理员
    avatar: String,
    createTime: Date,
    updateTime: Date
}

const UserModel = moongoose.model("user", new Schema(userType))

module.exports = UserModel